Called before starting the dev server.

Use the `server` parameter to get the dev server instance, see [Dev server API](/api/javascript-api/dev-server-api) for more information.

- **Type:**

```ts
type OnBeforeStartDevServerFn = (params: {
  /**
   * The dev server instance, the same as the return value of `createDevServer`.
   */
  server: RsbuildDevServer;
  /**
   * A read-only object that provides some context information about different environments.
   */
  environments: Record<string, EnvironmentContext>;
}) => MaybePromise<void>;

function OnBeforeStartDevServer(callback: OnBeforeStartDevServerFn): void;
```
